package com.tensquare.user.config;

import com.tensquare.user.intercepter.JwtIntercepter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author zzb
 * @version 1.0
 * @create 2020/12/23 13:16
 * 配置拦截器
 */
@Configuration
public class JwtInercepterConfig implements WebMvcConfigurer {
    @Autowired
    private JwtIntercepter jwtIntercepter;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(jwtIntercepter).addPathPatterns("/**").excludePathPatterns("/**login");
    }
}
